package main

import (
	"fmt"
)

func main() {
	var countryCapitalMap map[string]string   // 创建集合
	countryCapitalMap = make(map[string]string)

	// map插入key - value 
	countryCapitalMap ["A"] = "a"
	countryCapitalMap ["B"] = "b"
	countryCapitalMap ["C"] = "c"

	// 打印信息
	for country := range countryCapitalMap {
		fmt.Println(country, "的小写是", countryCapitalMap[country])
	}

	// 查看元素在集合中是否存在
	captial, ok := countryCapitalMap["D"]
	fmt.Println(captial, ok)		
	
	// delete() 删除集合的元素 
	myMap := map[string]string{"A":"a", "B":"b"}
	fmt.Println(myMap)
	delete(myMap, "B")
	fmt.Println(myMap)
}